#include "cgmaterial.h"

CgMaterial::CgMaterial()
{
}

CgMaterial::CgMaterial(CgColor ambient, CgColor diffuse, CgColor specular)
    : ambient_(ambient), diffuse_(diffuse), specular_(specular)
{
}

CgMaterial::CgMaterial(const CgMaterial &material)
{
    ambient_ = material.ambient();
    diffuse_ = material.diffuse();
    specular_ = material.specular();
}

CgMaterial& CgMaterial::operator=(const CgMaterial &material)
                                 {
    if( this != &material ) {
        ambient_ = material.ambient();
        diffuse_ = material.diffuse();
        specular_ = material.specular();
    }

    return *this;
}

void CgMaterial::set_ambient(CgColor ambient)
{
    ambient_ = ambient;
}

void CgMaterial::set_diffuse(CgColor diffuse)
{
    diffuse_ = diffuse;
}

void CgMaterial::set_specular(CgColor specular)
{
    specular_ = specular;
}

CgColor CgMaterial::ambient() const
{
    return ambient_;
}

CgColor CgMaterial::diffuse() const
{
    return diffuse_;
}

CgColor CgMaterial::specular() const
{
    return specular_;
}
